package com.example.api.controller;

import com.example.api.aspect.SystemControllerLog;
import com.example.api.model.entity.Menu;
import com.example.api.model.enums.ActionTypeEnum;
import com.example.api.service.MenuService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Api(tags = "菜单管理")
@RestController
@RequestMapping("/system/config")
public class MenuController {
    
    @Resource
    private MenuService menuService;
    
    @ApiOperation("根据用户id查询菜单列表")
    @GetMapping("/menu")
    @SystemControllerLog(description = "根据用户id查询菜单列表", actionType = ActionTypeEnum.QUERY)
    public List<Menu> getMenusByAdminId() {
        return menuService.getMenusByAdminId();
    }
    
}